#ifndef _CLI_COMMAND_H_
#define _CLI_COMMAND_H_

#include "FreeRTOS_CLI.h"
#include <stddef.h>
#include <stdint.h>

/* 只读视图 */
typedef struct
{
  const char *broker;
  uint16_t port;
  const char *client;
  const char *user;
  const char *pass;
} MQTTConf_RO_t;

/* CLI 入口 */
BaseType_t mqtt_cli_command(char *pcWriteBuffer, size_t xWriteBufferLen,
                            const char *pcCommandString);

/* 弱钩子：配置变化后自动调用（用户可外部实现） */
void mqtt_cli_on_change(void);

/* 只读访问当前五元组 */
MQTTConf_RO_t mqtt_cli_get_config(void);

/* 外部声明：注册表已定义在 .c 末尾 */
extern const CLI_Command_Definition_t xMQTTCommand;

typedef enum
{
  SFP_MODE_UNKNOWN = 0,
  SFP_MODE_AUTO,
  SFP_MODE_1G,
  SFP_MODE_10G
} sfp_mode_t;

/*=================  工具：模式转字符串  ================*/
static const char *mode2str(sfp_mode_t m);

/*=================  CLI 处理函数  ================*/
static BaseType_t sfp_cli_command(char *pcWriteBuffer,
                                  size_t xWriteBufferLen,
                                  const char *pcCommandString);
/*=================  注册表入口  ================*/
extern const CLI_Command_Definition_t xSFPCommand;

static BaseType_t factory_cli_command(char *pcWriteBuffer,
                                      size_t xWriteBufferLen,
                                      const char *pcCommandString);
extern const CLI_Command_Definition_t xFactoryCommand;

static BaseType_t dummy_empty_command(char *pcWriteBuffer,
                                      size_t xWriteBufferLen,
                                      const char *pcCommandString);
extern const CLI_Command_Definition_t xEmptyLineCommand;

extern const CLI_Command_Definition_t xRestartCommand;

extern const CLI_Command_Definition_t xVLANCommand;
#endif
